﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace DGZImp.MdsProject.Devices.Models
{
    public class DbBlockCfgItem
    {
        public string DbBlock { get; set; }
        public ushort Length { get; set; }
    }

    public class PlcDataMapItem
    {
        public string PropName { get; set; }
        public bool Readable { get; set; } = true;
        public string DbBlock { get; set; }
        public ushort Offset { get; set; }
        public DataTypeEnum DataType { get; set; }
        public ushort Length { get; set; }
        public bool Writable { get; set; }
        public string WriteAddress { get; set; }
    }

    public class PlcDataWriteItem
    {
        public string PropName { get; set; }
        public object Value { get; set; }
    }

    public class PlcWriteItem
    {
        public string Address { get; set; }
        public DataTypeEnum DataType { get; set; }
        public object Value { get; set; }
    }

    public class DeviceActionInfo
    {
        public string Name { get; set; }
        public string Description { get; set; }
        public string ActionName { get; set; }
        public ParameterDto[] Parameters { get; set; }
    }

    public class ParameterDto
    {
        public string Name { get; set; }
        public string Description { get; set; }
        public string Type { get; set; }
        public bool IsOptional { get; set; }
        public List<ParameterOptionsItem> Options { get; set; }
    }

    public class ParameterOptionsItem
    {
        public string Label { get; set; }
        public int Value { get; set; }
    }
}
